package com.geek.javase.wcy03.relation.Game;

/**
 * @author wangchaoyang
 * @desc TODO
 * @date 2025/9/3
 */
public abstract class Role {

    private String name;
    private int level;
    private int blood;
    private String kind;
    private int power;
    private int defence;

    /**
     * 抽象方法 - 基本攻击方法
     * 多态参数：声明时使用的是父类类型，实际传递的是子类类型
     */
    public abstract void attack(Role role);

    /**
     * 死亡判定方法
     * @return 返回true代表已死亡，返回false代表健在
     */
    public boolean isDead(){
        if(this.blood<=0){
            return true;
        }
        return false;
    }

    /**
     * 获取角色信息的方法
     */
    public abstract void show();

    public Role() {
    }

    public Role(String name, int level, int blood, String kind, int power, int defence) {
        this.name = name;
        this.level = level;
        this.blood = blood;
        this.kind = kind;
        this.power = power;
        this.defence = defence;
    }

    /**
     * 获取
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取
     * @return level
     */
    public int getLevel() {
        return level;
    }

    /**
     * 设置
     * @param level
     */
    public void setLevel(int level) {
        this.level = level;
    }

    /**
     * 获取
     * @return blood
     */
    public int getBlood() {
        return blood;
    }

    /**
     * 设置
     * @param blood
     */
    public void setBlood(int blood) {
        this.blood = blood;
    }

    /**
     * 获取
     * @return kind
     */
    public String getKind() {
        return kind;
    }

    /**
     * 设置
     * @param kind
     */
    public void setKind(String kind) {
        this.kind = kind;
    }

    /**
     * 获取
     * @return power
     */
    public int getPower() {
        return power;
    }

    /**
     * 设置
     * @param power
     */
    public void setPower(int power) {
        this.power = power;
    }

    /**
     * 获取
     * @return defence
     */
    public int getDefence() {
        return defence;
    }

    /**
     * 设置
     * @param defence
     */
    public void setDefence(int defence) {
        this.defence = defence;
    }

    public String toString() {
        return "Role{name = " + name + ", level = " + level + ", blood = " + blood + ", kind = " + kind + ", power = " + power + ", defence = " + defence + "}";
    }

}

